/*
 * Alberto De Pena
 * Applied Algorithms
 * cubes.cpp
 */
#include <fstream>

using namespace std;

void main()
{
	ifstream fin( "cubes.in" );
	ofstream fout( "cubes.out" );

	int m, n;

	fin >> m >> n;
	while( m != 0 && n != 0 )
	{
		for( int a = m; a <= n; a++ )
		{
			int A = a*a*a;
			for( int b = 1; b <= n; b++ )
			{
				int B = b*b*b;
				for( int c = b; c <= n; c++ )
				{
					int C = c*c*c;
					for( int d = c; d <= n; d++ )
					{
						if( A == B + C + d*d*d )
						{
							fout << a << " = f(" << b << "," << c << "," << d << ")" << endl;
						}
					}
				}
			}
		}
		fout << "+++" << endl;

		fin >> m >> n;
	}

	fin.close();
	fout.close();
}